package samples.chapter02;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/chapter02")
@RestController
public class Chapter02BookController {
    Chapter02Book book;

    public Chapter02BookController(@Autowired Chapter02Book book) {
        this.book = book;
    }

    @GetMapping("/book")
    public String book() {
        return book.toString();
    }
}
